#ifndef CL_ADDITEM_H
#define CL_ADDITEM_H

#include <head/g_pch.h>
#include <head/m_message.h>
#include "m_fhs.h"

namespace Ui {
class CL_AddItem;
}

class CL_AddItem : public QDialog
{
    Q_OBJECT

public:
    explicit CL_AddItem(QWidget *parent,
                        const QStringList &entries);
    ~CL_AddItem();

    void setEntry(const QString &entry,int version=1002);
    void setItem(int id,
                 const QString &entry,
                 int version,
                 const QString &detail);

signals:
    void addItem(const QJsonObject &obj);
    void updateItem(const QJsonObject &obj);

private slots:
    void on_entries_currentTextChanged(const QString &entry);
    void on_btn_submit_clicked();

private:
    Ui::CL_AddItem *ui;

    int _id,_version;
    QString _entry,_detail;
};

#endif // CL_ADDITEM_H
